We present models of photometric evolution of galaxies in which the effects of a dusty interstellar medium have been included with particular care. A chemical evolution code follows the star formation rate, the gas fraction and the metallicity, basic ingredients for the stellar population synthesis. The latter is performed with a grid of integrated spectra of simple stellar populations (SSP) of different ages and metallicities, in which the effects of dusty envelopes around asymptotic giant branch (AGB) stars are included. The residual fraction of gas in the galaxy is divided into two phases: the star forming molecular clouds and the cirrus. The relative amount is a model parameter. The molecular gas is sub--divided into clouds of given mass and radius: it is supposed that each SSP is born within the cloud and progressively escapes it. The emitted spectrum of the star forming molecular clouds is computed with a radiative transfer code. The cirrus emission is derived by describing the galaxy as an axially symmetric system, in which the local dust emissivity is consistently calculated as a function of the local field intensity due to the stellar component. Effects of very small grains, subject to temperature fluctuations, as well as PAHs are included. The model is compared and calibrated with available data of normal and starburst galaxies in the local universe, in particular new broad--band and spectroscopic ISO observations. It will be a powerful tool to investigate the star formation, the IMF, supernovae rate in nearby starbursts and normal galaxies, as well as to predict the evolution of luminosity functions of different types of galaxies at wavelengths covering four decades.